<?php
/**
 * Created by PhpStorm.
 * User: Jie
 * Date: 4/20/2016
 * Time: 5:52 PM
 */
class RedirectController extends \Core_BaseCtl
{
    public function indexAction() {
        //读取配置文件
        $config = \Yaf_Registry::get('configarr');
        $website = $config['weisite']['address'];

        $content = $this->getg('c') ? $this->getg('c') : '';
        $url = $this->getg('u') ? $this->getg('u') : '';

        if(!$content || !$url) {
            $content = '输入有误';
            $url = Tools_help::url('index/mobileregister/login');
        } else {
            $url = $website . $url;
        }
        $pageTitle = '成功提示';

        $this->_view->assign('pageTitle', $pageTitle);
        $this->_view->assign('content', $content);
        $this->_view->assign('url', $url);
    }

    public function errorAction() {
        //读取配置文件
        $config = \Yaf_Registry::get('configarr');
        $website = $config['weisite']['address'];

        $content = $this->getg('c') ? $this->getg('c') : '';
        $url = $this->getg('u') ? $this->getg('u') : '';

        if(!$content || !$url) {
            $content = '输入有误';
            $url = Tools_help::url('index/mobileregister/login');
        } else {
            $url = $website . $url;
        }
        $pageTitle = '错误提示';

        $this->_view->assign('pageTitle', $pageTitle);
        $this->_view->assign('content', $content);
        $this->_view->assign('url', $url);
    }
}